﻿using System;
using System.ComponentModel.DataAnnotations;

namespace Models
{
    //Client Profile Model
    [MetadataType(typeof(ClientProfile.Metadata))]
    public partial class ClientProfile
    {
        internal sealed class Metadata
        {
            private Metadata() { }

            [Display(Name = "Name")]
            [Required(ErrorMessage = "{0} is required.", AllowEmptyStrings = false)]
            [StringLength(250, MinimumLength = 3, ErrorMessage = "{0} needs to be between {2} and {1} characters long.")]
            public string Name;

            [Display(Name = "NRIC")]
            [Required(ErrorMessage = "{0} is required.", AllowEmptyStrings = false)]
            [StringLength(150, MinimumLength = 3, ErrorMessage = "{0} needs to be between {2} and {1} characters long.")]
            public string NRIC;

            [Display(Name = "Gender")]
            public Nullable<byte> GenderId;

            [Display(Name = "Race")]
            public Nullable<short> RaceId;

            [Display(Name = "Age")]
            [Range(1, 100, ErrorMessage = "{0} needs to be between {1} and {2}.")]
            public Nullable<byte> Age;

            [Display(Name = "Family Contact Number")]
            [StringLength(100, ErrorMessage = "{0} cannot be longer than {1} characters.")]
            public string FamilyContactNo;

            [Display(Name = "Medical Condition")]
            [RegularExpression(@"[^<>]*", ErrorMessage = "HTML tags are not allowed.")]
            public string MedicalCondition;

            //public Gender Gender { get; set; }
            //public Race Race { get; set; }
        }
    }
}
